<?php
    include('header.php');
    include('submenu.php');
    
    $cc_id = $_GET['cc_id'];
    $sql = "SELECT * FROM customer_company WHERE cc_id=$cc_id";
    $comapny_info = $db->Execute($sql);
?>
    <div class="grid_18" id="contents">
        
        <div id="contents_">
            <h2 class="page_title">Add Company</h2>
            <form action="?m=customer&s=company_edit_query" method="post" target="ajax_iframe">
	    <input type="hidden" name="cc_id" class="input large" value="<?php echo $cc_id; ?>" />
            <div id="about_us_company_msg_1_en" class="form_field">
                <p>Code: </p>
                <input type="text" name="cc_code" class="input large" value="<?php echo $comapny_info->fields['cc_code']; ?>" />
            </div>
            <div id="about_us_company_msg_1_en" class="form_field">
                <p>Company Name : </p>
                <input type="text" name="cc_name" class="input large" value="<?php echo $comapny_info->fields['cc_name']; ?>" />
            </div>
            <div id="about_us_company_msg_1_en" class="form_field">
                <p>Address 1 : </p>
                <textarea class="styled_textarea large height120" name="cc_address1"><?php echo $comapny_info->fields['cc_address1']; ?></textarea>
            </div>
            <div id="about_us_company_msg_1_en" class="form_field">
                <p>Address 2 : </p>
                <textarea class="styled_textarea large height120" name="cc_address2"><?php echo $comapny_info->fields['cc_address2']; ?></textarea>
            </div>
            <div id="about_us_company_msg_1_th" class="form_field">
                <p>Website : </p>
                <!--<p class="guideline">ใช้ , คั่นระหว่างเว็บไซต์</p>-->
                <input type="text" name="cc_website" class="input large" value="<?php echo $comapny_info->fields['cc_website']; ?>" />
            </div>
            <div id="about_us_company_msg_1_th" class="form_field">
                <p>Budget : </p>
                <input type="text" name="cc_budget" class="input large" value="<?php echo $comapny_info->fields['cc_budget']; ?>" />
            </div>
            <div id="about_us_company_msg_1_th" class="form_field">
                <p>Remark : </p>
                <textarea class="styled_textarea large height120" name="cc_remark"><?php echo $comapny_info->fields['cc_remark']; ?></textarea>
            </div>
            
            <div id="about_us_company_msg_2_en" class="form_field">
                <button class="button" id="ajax_button">SAVE</button>
                <img src="images/ajax-loader.gif" id="ajax_loader" class="display_none" />
            </div>
            </form>
            <iframe name="ajax_iframe" class="display_none"></iframe>
        </div>
        
    </div><!-- end .grid_18 -->
    <div class="clear">&nbsp;</div>
<?php
    include('footer.php');
?>
<script>
    $(document).ready(function(){
        $('#ajax_button').live('click',function(){
            $('#ajax_loader').css('display','inline');
        });
    });
</script>